{% extends "base.html" %}

{% block title %}登录 - 机器人管理系统{% endblock %}

{% block login_content %}
<div class="flex items-center justify-center min-h-screen bg-gray-50">
    <div class="w-full max-w-md bg-white rounded-xl shadow-lg p-8">
        <div class="text-center mb-8">
            <div class="w-16 h-16 rounded-lg bg-primary flex items-center justify-center mx-auto mb-4">
                <i class="fa fa-robot text-white text-2xl"></i>
            </div>
            <h1 class="text-2xl font-bold text-dark">机器人管理系统</h1>
            <p class="text-dark-2 mt-2">请登录以继续</p>
        </div>
        
        <!-- 消息提示 -->
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                <div class="mb-6">
                    {% for category, message in messages %}
                        <div class="p-4 rounded-lg {% if category == 'success' %}bg-success/10 text-success{% elif category == 'danger' %}bg-danger/10 text-danger{% else %}bg-light-1 text-dark-2{% endif %}">
                            {{ message }}
                        </div>
                    {% endfor %}
                </div>
            {% endif %}
        {% endwith %}
        
        <form method="post">
            <div class="mb-4">
                <label for="username" class="block text-sm font-medium text-dark mb-1">用户名</label>
                <div class="relative">
                    <i class="fa fa-user absolute left-3 top-1/2 transform -translate-y-1/2 text-dark-2"></i>
                    <input type="text" id="username" name="username" required
                        class="pl-10 pr-4 py-3 rounded-lg border border-light-2 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary w-full">
                </div>
            </div>
            
            <div class="mb-6">
                <label for="password" class="block text-sm font-medium text-dark mb-1">密码</label>
                <div class="relative">
                    <i class="fa fa-lock absolute left-3 top-1/2 transform -translate-y-1/2 text-dark-2"></i>
                    <input type="password" id="password" name="password" required
                        class="pl-10 pr-4 py-3 rounded-lg border border-light-2 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary w-full">
                </div>
            </div>
            
            <button type="submit" class="w-full py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium">
                登录
            </button>
        </form>
        
        <div class="mt-6 text-center">
            <a href="#" class="text-primary text-sm hover:underline">忘记密码?</a>
        </div>
    </div>
</div>
{% endblock %}
